package com.autonavi.abs.generator.common.enumeration;

/**
 * @author tianquan.ld
 * @version V1.0
 * <p>Description: 模板配置</p>
 * @date 2020-08-10 17:25
 */
public enum TemplateEnum {

    // 应用级别文件
    ApplicationYaml("/application/ApplicationYml.ftl", "/src/main/resources/", "application.yml", GenerateTypeEnum.App),
    Pom("/application/pom.ftl", "", "pom.xml", GenerateTypeEnum.App),
    Application("/application/Application.ftl", "src/main/java/%s/", "Application.java", GenerateTypeEnum.App),
    Env("/application/env.ftl", "src/main/profiles/local/", "env.properties", GenerateTypeEnum.App),
    SpringTddl("/application/spring-tddl.ftl", "src/main/resources/", "spring-tddl.xml", GenerateTypeEnum.App),
    Logback("/application/logback-spring.ftl", "src/main/resources/", "logback-spring.xml", GenerateTypeEnum.App),
    GitIgnore("/application/gitignore.ftl", "", ".gitignore", GenerateTypeEnum.App),
    Release("/application/release.ftl", "", "%s.release", GenerateTypeEnum.App),
    Assembly("/application/assembly.ftl", "", "assembly.xml", GenerateTypeEnum.App),

    // 应用配置文件
    Config_TDDL("/config/TddlConfig.ftl", "/src/main/java/%s/config/", "TddlConfig.java", GenerateTypeEnum.App),
    Config_ADB("/config/AdbConfig.ftl", "/src/main/java/%s/config/", "AdbConfig.java", GenerateTypeEnum.App),

    // 单个文件
    Constant("/common/Constant.ftl", "src/main/java/%s/common/", "Constant.java", GenerateTypeEnum.App),
    CheckController("/controller/CheckController.ftl", "src/main/java/%s/controller/", "CheckController.java", GenerateTypeEnum.App),

    // 模块文件
    Dto("/model/dto/DTO.ftl", "src/main/java/%s/model/dto/", "DTO.java", GenerateTypeEnum.Module),
    Query("/model/query/Query.ftl", "src/main/java/%s/model/query/", "Query.java", GenerateTypeEnum.Module),
    Vo("/model/vo/VO.ftl", "src/main/java/%s/model/vo/", "VO.java", GenerateTypeEnum.Module),
    Dao("/dao/DAO.ftl", "src/main/java/%s/dao/", "DAO.java", GenerateTypeEnum.Module),
    Mapper("/mapper/Mapper.ftl", "src/main/resources/mapper/", "Mapper.xml", GenerateTypeEnum.Module),
    Service("/service/Service.ftl", "src/main/java/%s/service/", "Service.java", GenerateTypeEnum.Module),
    ServiceImpl("/service/impl/ServiceImpl.ftl", "src/main/java/%s/service/impl/", "ServiceImpl.java", GenerateTypeEnum.Module),
    Controller("/controller/Controller.ftl", "src/main/java/%s/controller/", "Controller.java", GenerateTypeEnum.Module),
    Hsf("/hsf/HsfService.ftl", "src/main/java/%s/rservice/", "HsfService.java", GenerateTypeEnum.Module),
    HsfImpl("/rservice/HsfServiceImpl.ftl", "src/main/java/%s/rservice/impl/", "HsfServiceImpl.java", GenerateTypeEnum.Module),
    ;

    /**
     * 模板文件
     */
    private String template;
    /**
     * 文件生成路径
     */
    private String targetPath;
    /**
     * 生成文件名的后部分
     */
    private String targetSuffix;
    /**
     * 生成方式
     */
    private GenerateTypeEnum generateType;

    TemplateEnum(String template, String targetPath, String targetSuffix, GenerateTypeEnum generateType) {
        this.template = template;
        this.targetPath = targetPath;
        this.targetSuffix = targetSuffix;
        this.generateType = generateType;
    }

    public String getTemplate() {
        return template;
    }

    public String getTargetSuffix() {
        return targetSuffix;
    }

    public GenerateTypeEnum getGenerateType() {
        return generateType;
    }

    public String getTargetPath() {
        return targetPath;
    }
}
